package com.vincent.utils;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by wensen on 2016/12/8.
 * configuration: 配置信息，包含了一系列的replica、acceptor和leader
 *
 */
public class Config {

    private List<Integer> replicas;
    private List<Integer> acceptors;
    private List<Integer> leaders;

    public Config() {
        replicas  = new ArrayList<Integer>();
        acceptors = new ArrayList<Integer>();
        leaders   = new ArrayList<Integer>();
    }

    public void replicas(List<Integer> res) {
        for (Integer r:res) {
            this.replicas.add(r);
        }
    }

    public List<Integer> replicas() {
        return replicas;
    }

    public void acceptors(List<Integer> acs) {
        for (Integer a : acs) {
            this.acceptors.add(a);
        }
    }

    public List<Integer> acceptors() {
        return acceptors;
    }

    public void leaders(List<Integer> ls)  {
        for (Integer l : ls) {
            this.leaders.add(l);
        }
    }

    public List<Integer> leaders() {
        return leaders;
    }

}
